

function addSensorbitCod(Blockly) {




    //触摸传感器
    Blockly.Python.microbit_touch = function (block) {
        var dropdown_microbitTouch = this.getFieldValue('microbitTouch');
        Blockly.Python.definitions_['import_microbit'] = 'from microbit import *\n';
        Blockly.Python.definitions_['import_Touch'] = 'from input import touch\n';
        // Blockly.Python.definitions_['import_touch'] = 'import Touch\n';
        var code = 'touch.is_touched(' + dropdown_microbitTouch + ')';
        return [code];
    }

    return Blockly;
}

module.exports = addSensorbitCod;

